<?php 
	class Blog_model extends CI_Model{
		public function get_last(){
			$query=$this->db->get('catalog');
			return $query->result();
		}
		public function getAll(){
			$query=$this->db->get('article');
			return $query->result();
		}
		public function get_Once($id){
			$query=$this->db->where('id' ,$id)->get('article');
			return $query->row();
		}
		public function view_Once($id){
			$query=$this->db->query("update article set `view`=`view`+1 where id=$id");
		}
		public function get_lists($catalog_id){
			$query=$this->db->where('catalog_id',$catalog_id)->get('article');
			return $query->result();
		}
	}